import http from "@/utils/request/httpRequest.ts";
import type { ListPagination, ListType } from "@/types/commonType.ts";
import type { ExpertListType, ExpertAddType, ExpertUpdateType, OtherListType, ListRacetrackType } from "@/types/expertManagement"

export const expertListApi = (params: ListPagination & {
    trueName: string
}) => http.get<ListType<ExpertListType[]>>('teacher/pageTeacher', {
    params
})

export const expertAddApi = (data: ExpertAddType) => http.post<string>("teacher/add", data)

export const expertEditApi = (data: ExpertUpdateType) => http.post<string>("teacher/update", data)

export const selectListAll = () => http.get<OtherListType[]>('sys/dict/listAll')

// 赛道下拉列表-企业
export const listRacetrack = () => http.get<ListRacetrackType[]>('sys/dict/listRacetrack')
// 常规赛道下拉列表
export const listNormalRacetrack = () => http.get<ListRacetrackType[]>('sys/dict/listNormalRacetrack')

export const expertDeleteApi = (data: {
    id: string
}) => http.post('teacher/delete', data)

//  下载导入模板
export const downLoad = (data:object) => http.get("file/downloadXlsx", {
    responseType: "blob",
    params: data
})
